#!/bin/bash

cd /
image=$1

# check if directory exists
if [ ! -d $image ]
then
 echo "The directory $patchdir doesn't exist"
 echo "Please specify directory containing the patch files."
 exit 1
fi

image=$1


rpm -ivh $image/mod_*rpm --nodeps --force
rpm -ivh $image/mm*rpm --nodeps --force
rpm -ivh $image/expat*rpm --nodeps --force
rpm -ivh $image/openssh*rpm  --nodeps --force
rpm -Fvh $image/apache*rpm 

#lets update the version
#first lets see if the version already has the security fix indicator

grep "RHSA-2002:103-18" /opt/hsc/data/version
if [ "$?" -ne "0" ]
then
  echo "RHSA-2002:103-18" >> /opt/hsc/data/version
fi

grep "RHSA-2002:127-18" /opt/hsc/data/version
if [ "$?" -ne "0" ]
then
  echo "RHSA-2002:127-18" >> /opt/hsc/data/version
fi


exit 0
